package com.gizwits.akka

import akka.actor._
import akka.actor.Actor
import  akka.io._
import akka.io.Tcp


class HelloActor extends Actor {


  def receive = {

    case "hello" => println("world")
    case "stop" => context.stop(self)

    case _ => println("huh?")

  }

}

object HelloAkka {

  def main(args: Array[String]) {

    // import akka.actor._
    val system = ActorSystem("HelloSystem")
    // default Actor constructor


    val helloActor = system.actorOf(Props[HelloActor], name = "helloactor")
    helloActor ! "Hello"
    helloActor ! "hello"
    helloActor ! "stop"
    system.shutdown()
    // helloActor.tell(PoisonPill, ActorRef.noSender)

  }

}
